const mongoose = require('mongoose')

mongoose.connect('mongodb://localhost:27017/test', { useUnifiedTopology: true })

const Schema = mongoose.Schema

const commentSchema = new Schema({
    topicId: {
        type: String,
        require: true
    },
    commentContent: {
        type: String,
        required: true
    },
    createdTime: {
        type: Date,
        default: Date.now
    },
    commentName: {
        type: String,
        required: true
    }
})

module.exports = mongoose.model('comment', commentSchema)